import http from '@/utils/request'
import request from '@/utils/requestOther'


export default{

    /**
      * 按条件查询即时天气
      * @returns
      */
  async getOnlineWeatherApi(params){
    return await http.get("/api/resource/weather/online",params);
  },
  async dynamicOnline(params){
    return await http.get("/api/resource/weather/dynamicOnline",params);
  },
   /**
      * 按条件查询历史天气
      * @returns
      */
   async getHistoryWeatherApi(params){
    return await http.get("/api/resource/weather/history",params);
  },

     /**
      * 查询分配城市树列表
      * @returns
      */
     async getAssignUserWeatherTreeApi(params){
        return await http.get("/api/resource/weather/getAssignUserWeatherTree",params);
    },

     /**
    * 
    * @returns 分配用户城市天气
    */
     async assignSaveUserWeatherApi(params){
        return await http.post("/api/resource/weather/saveUserWeatherAssign",params);
    },

      /**
    * 
    * @returns weatherApi获取
    */
      async getWeatherApi(params){
        return await http.get("/api/resource/weatherApi/list",params);
    },

      /**
    * 
    * @returns weatherApi新增
    */
      async addWeatherApi(params){
        return await http.post("/api/resource/weatherApi/add",params);
    },

     /**
    * 
    * @returns weatherApi修改
    */
         async editWeatherApi(params){
          return await http.put("/api/resource/weatherApi/edit",params);
      },

    /**
    * 
    * @returns weatherApi删除
    */
        async deleteWeatherApi(params){
          return await http.delete("/api/resource/weatherApi/delete",params);
      },

    /**
    * 
    * @returns weatherApi改变启用状态
    */
    updateState(id, state) {
      return request({
          url: `/api/resource/weatherApi/updateState/${id}/${state}`,
          method: 'put'
      })
  },
     /**
    *  展示所有构建部分固定条件的WeatherApi
    * @returns 
    */
     async getRequestsApi(params){
      return await http.get("/api/resource/weatherApi/build",params);
     },

    
  /**
    * 
    * @returns 测试天气连接
    */
  async sendRequest(params){
    return await http.get("/api/resource/weatherApi/sendRequest",params);
   },
 
}